package com.example.demo.controller;


import com.demo.persistent.StudentController;
import com.example.demo.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    StudentController studentController = new StudentController();

    @RequestMapping("/hello")
    public String hello() {
        return studentController.getStudent().toString();
    }


    @RequestMapping("/helloStudent")
    @ResponseBody
    public Result helloStudent() {
        return new Result(studentController.getStudent());
    }
}
